import 'package:flutter/material.dart';
import 'package:flutter01/widgets/alpha_image_Ignore_pointer.dart';

class AlphaImageIgnorePointerIndex extends StatefulWidget {
  const AlphaImageIgnorePointerIndex({Key? key}) : super(key: key);

  @override
  State<AlphaImageIgnorePointerIndex> createState() =>
      _AlphaImageIgnorePointerIndexState();
}

class _AlphaImageIgnorePointerIndexState
    extends State<AlphaImageIgnorePointerIndex> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('图片透明部分事件透传'),
      ),
      body: Center(
        child: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Container(
              decoration: BoxDecoration(border: Border.all(color: Colors.red)),
              child: AlphaImageIgnorePointer(
                size: Size(120, 120),
                path: 'images/empty.png',
                onTap: () {
                  debugPrint('tap image');
                },
              ),
            ),
            SizedBox(width: 20),
            Container(
              decoration: BoxDecoration(border: Border.all(color: Colors.red)),
              child: AlphaImageIgnorePointer(
                size: Size(120, 120),
                path: 'images/nopage.png',
                onTap: () {
                  debugPrint('tap image');
                },
              ),
            ),
          ],
        ),
      ),
    );
  }
}
